import request from '@/utils/request'

/**
 * 分页获取
 */
export function getOrderByPage(params, pageNum, pageSize, token) {
    return request({
        url: '/order/list/page',
        method: 'get',
        params: {
            ...params,
            pageNum,
            pageSize,
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 保存
 */
export function addOrUpdateOrder(data, token) {
    return request({
        url: '/order/addOrUpdate',
        method: 'post',
        params: {
            ...data
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 订单信息详情
 */
export function getOrderDetail(id, token) {
    return request({
        url: '/order/getOrderDetail/' + id,
        method: 'get',
        headers: {
            'token': token
        }
    })
}

/**
 * 删除订单信息
 */
export function delOrderById(id, token) {
    return request({
        url: '/order/delOrderById/' + id,
        method: 'post',
        headers: {
            'token': token
        }
    })
}